/**
 * 
 */
package mapreduce4j;

import java.util.concurrent.Callable;

import org.apache.hadoop.mapreduce.Mapper;

/**
 * @author tim
 *
 */
public class CallableMapper implements Callable {
	protected Mapper mapper;
	protected Mapper.Context context;
	
	public CallableMapper(Mapper mapper, Mapper.Context context) {
		this.mapper = mapper;
		this.context = context;
	}

	/**
	 * @see java.util.concurrent.Callable#call()
	 */
	public Object call() throws Exception {
		try {
			mapper.run(context);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
